<?php
defined( '_VALID_MOS' ) or die( 'Restricted access' );
class HTML_gallery {
	//show Gallery
	function showGallery( &$rows ){
		global $mosConfig_live_site;
		$url = $mosConfig_live_site."/administrator/components/com_gallery/uploads/";
		?>
		<div id="title-cat"><div>Thư viện ảnh</div></div>
    	<div id="content-cat">
			<div id="tab_content">
				<ul id="show_photo">
					<?php
					for ($i=0; $i<count($rows); $i++){
					if ($i%20==0 && $i>0){
						echo '</ul>';
						echo '<ul id="show_photo">';
					}
					if (($i+1)%4==0 && $i>0){
						$style = ' style="margin-right:0;"';
					}else{
						$style = '';
					}
					?>
					<li class="li_gallery">
						<div class="gallery_box"<?php echo $style;?>><a href="<?php echo $url.$rows[$i]->image;?>"><img src="<?php echo $url.$rows[$i]->image;?>" border="0" /></a></div>
					</li>
					<?php
					}
					?>
				</ul>
			</div>
			<?php if (count($rows)>20){?>
			<div class="clear"></div>
			<div id="tab_content_page">
				<a href="#" id="btn_tab_prev">Prev</a>
				<a href="#" id="btn_tab_next">Next</a>
			</div>
			<?php }?>	
		</div>
		<?php
	}
}
?>